package 力扣日常刷题.木22二月.第14天220;

import 力扣日常刷题.TreeNode;

import java.util.TreeMap;

/**
 * @author 帅小伙
 * @date 2022/2/20
 * @description
 */
public class Demo108反转二叉树 {

    public TreeNode invertTree(TreeNode root) {
        if (root == null) return root;
        TreeNode left = invertTree(root.left);
        TreeNode right = invertTree(root.right);
        root.left = right;
        root.right = left;
        return root;
    }

}
